package com.bf.electroplating.pojo.enums;

import lombok.Getter;

@Getter
public enum ProblemTypeEnum {

    SS("0", "涉水问题"),
    FG("1", "固废问题"),
    ;

    private final String code;
    private final String desc;

    private ProblemTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getDesc(String code) {
        for (ProblemTypeEnum item : ProblemTypeEnum.values()) {
            if (item.getCode().equals(code)) {
                return item.getDesc();
            }
        }
        return null;
    }

    public static String getCode(String desc) {
        for (ProblemTypeEnum item : ProblemTypeEnum.values()) {
            if (item.getDesc().equals(desc)) {
                return item.getCode();
            }
        }
        return null;
    }

}
